package com.tte.common.anno.controller;

import com.tte.common.service.UserService;
import com.tte.common.model.vo.UserQueryVO;
import com.tte.common.anno.service.AnnoService;
import com.tte.common.model.tenum.ResultCode;
import com.tte.common.model.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TestAnnoContorller
 * @Author DongWH
 * @Date 2024/11/4 15:11
 */
@RestController
@RequestMapping("/anno")
public class TestAnnoContorller {

    @Autowired
    private AnnoService annoService;
    @Autowired
    private UserService userService;

    @PostMapping("/test")
    public ResultBean requestModel(@RequestBody UserQueryVO userQueryVO){
        return new ResultBean(ResultCode.OK,annoService.test(userQueryVO));
    }

    @PostMapping("/getAlluser")
    public ResultBean getAlluser(){
        return new ResultBean(ResultCode.OK,userService.getAllUser());
    }

    @PostMapping("/getUser")
    public ResultBean getUser(){
        return new ResultBean(ResultCode.OK,userService.getUserById("1"));
    }
}